package com.hsteach.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hsteach.dao.domain.myopia.Myopia;
import com.hsteach.web.controller.myopia.dto.MyopiaListDTO;
import com.hsteach.web.controller.myopia.vo.GradeLevelStatVO;
import com.hsteach.web.controller.myopia.vo.MyopiaClassProportionVO;
import com.hsteach.web.controller.myopia.vo.MyopiaSchoolProportionVO;
import com.hsteach.web.controller.myopia.vo.SchoolStatVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 近视管理Mapper接口
 *
 * @author lx
 * @date 2023-07-07
 */
@Mapper
public interface MyopiaMapper extends BaseMapper<Myopia> {

    List<Myopia> selectListBySchoolId(@Param("dto") MyopiaListDTO dto);

    /**
     * 获取青少年占比
     * @param schoolId
     * @return
     */
    List<MyopiaSchoolProportionVO> getSchoolProportion(Long schoolId);

    /**
     * 获取年级近视程度
     * @param schoolId
     * @return
     */
    List<GradeLevelStatVO> getGradeLevelStat(Long schoolId);

    /**
     * 获取学校近视程度
     * @param schoolId
     * @return
     */
    GradeLevelStatVO getSchoolLevelStat(Long schoolId);

    /**
     * 获取班级近视青少年占比
     * @param schoolId
     * @return
     */
    List<MyopiaClassProportionVO> getClassProportion(Long schoolId);

    List<SchoolStatVo> getSchoolCount(@Param("name")String name,@Param("missionId")Long missionId);

    List<MyopiaSchoolProportionVO> getProportion(Long id);

    List<GradeLevelStatVO> getStageLevelStat(Long missionId);

    GradeLevelStatVO getLevelStat(Long missionId);

    List<MyopiaClassProportionVO> getAreaProportion(@Param("groupBy")String groupBy,@Param("missionId")Long missionId);

    List<Long> getAllStudentId(String schoolId);

    List<Myopia> areaList(@Param("dto")MyopiaListDTO dto);
}
